<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<div th:inline="text">
    <p>Hello,[[${userName}]] !</p>
    <br/>
</div>
</body>
</html>

<script th:inline="javascript">
    var msg='Hello'+[[${userName}]]+'!';
    alert(msg);
</script>